package com.lims.admin.service;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javacommon.base.*;

import cn.org.rapid_framework.page.*;

import com.lims.admin.model.*;
import com.lims.admin.dao.*;
import com.lims.admin.vo.query.*;

/**
 * @author zzh
 * @version 1.0
 * @since 1.0
 */@Service
@Transactional @SuppressWarnings("unchecked")
public class DictablesManager extends BaseManager<Dictables,java.lang.String>{

	private DictablesDao dictablesDao;
	/**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性,请注意大小写*/
	public void setDictablesDao(DictablesDao dao) {
		this.dictablesDao = dao;
	}
	
	public EntityDao getEntityDao() {
		return this.dictablesDao;
	}
	
	@Transactional(readOnly=true)
	public Page findPage(DictablesQuery query) {
		return dictablesDao.findPage(query);
	}
	
	@Transactional(readOnly=true)
	public ListRange findRange(DictablesQuery query) {
		Page page = this.dictablesDao.findPage(query);
		ListRange listRange = new ListRange();
		listRange.setRows(page.getResult().toArray());
		listRange.setTotal(page.getTotalCount());
		return listRange;
	}

	@Override
	@Transactional(readOnly=true)
	public List findAll() throws DataAccessException {
		String hql = "select d.objid,d.chineseName from Dictables d ";
		return this.dictablesDao.find(hql);
	}
	
	
	
}
